<?php
/**
 *
 * 版权所有：恰维网络<qwadmin.qiawei.com>
 * 作    者：寒川<hanchuan@qiawei.com>
 * 日    期：2016-01-21
 * 版    本：1.0.0
 * 功能说明：前台控制器演示。
 *
 **/
namespace Index\Controller;

use Vendor\Page;

class IndexController extends ComController
{
    //首页
    public function index(){
        //banner
        $bannerlist=M('banner')->select();
        $this->assign('_banner',$bannerlist);


        //精品推荐图
        $reclist=M('recomment')->select();
        $this->assign('_recomment',$reclist);

        //大咖面对面
        $tealist=M('teacher')->order('pop_num desc')->select();
        $this->assign('_teacher',$tealist);


        //跟咖实战
        $videoolist=M('video')->join('left join qw_teacher on qw_teacher.id=qw_video.t_id')->field('qw_video.*,qw_teacher.name')->order('join_num desc')->limit(0,3)->select();
        $this->assign('_video',$videoolist);

        //学员反馈
        $feedbacklist=M('student')->order('u_time desc')->limit(0,3)->select();
        $this->assign('fblist',$feedbacklist);

        //尾部
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }


    //牛咖直播
    public function live(){
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //牛咖直播详情
    public function live_detail(){
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }


    //跟咖实战
    public function combat(){
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //跟咖实战详情
    public function cb_detail(){
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //导师详情
    public function tea_detail(){
        $id=$_GET['id'];
        $teainfo=M('teacher')->where(array('id'=>$id))->find();
        $this->assign('teainfo',$teainfo);
        $this->display();
    }



    //学员反馈
    public function feedback(){
        $list=M('student')->select();
        $this->assign('list',$list);
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //学员反馈详情
    public function feedback_detail(){
        $id=$_GET['id'];
        $info=M('student')->where(array('id'=>$id))->find();
        $this->assign('info',$info);
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //个人中心
    public function user(){
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //关于我们
    public function about_us(){
        $info=M('aboutus')->where(1)->find();
        $this->assign('content',$info['content']);
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }

    //登录
    public function login(){
        $cominfo=M('info')->where(1)->find();
        $this->assign('cominfo',$cominfo);
        $this->display();
    }




}